// Copyright (c) 2023, zongying_cao@163.com
// All rights reserved.
//
// This software is licensed under the MIT License.
use crate::result::MyResult;
use gloo::console;

pub fn panic_if_err<T>(result: MyResult<T>) -> T {
    if result.is_err() {
        console::error!(format!("app panic:{}", result.err().unwrap()));
        panic!();
    }
    result.unwrap()
}
